﻿@using PNProject.EF;
@{
    ViewBag.Title = "Detail";
    Layout = "~/Views/Shared/_Layout1.cshtml";
    News news = (News)(ViewData["news"]);
    bool lang = (bool)(ViewData["lang"]);
    string langText = lang ? "" : "en-US/";
    List<News> relative = (List<News>)ViewData["relative"];
    string avatar = ViewData["avatar"].ToString();
}

<div class="search-bv">
    <form name="input" action="/@string.Concat(langText,"articles/search")" method="get">
        <input type="text" name="query" placeholder="Từ khóa bài viết" style="width:640px; height:16px; float:left; padding:5px 10px; border:1px solid #ddd; background:white; color:#333;" />
        <input type="submit" value="Search" style="width:68px; height:28px; float:right;" />
    </form>
</div>

<div class="chude"><a href="#"><p>Chủ đề:</p>@news.Title</a></div>
<div class="baiviet" style="margin-top:10px;">
    <div class="ctbaiviet">
    @{DateTime time = news.CreateDate.HasValue ? news.CreateDate.Value : DateTime.Now;}
                        	<div class="ngayvietchude"><p>@PNProject.PNLibraries.PNTimeFormat(time,false, lang)</p><a href="#">#1</a></div>
                            <div class="bvchude">
                                <ul>
                                    <li class="thanhvien">
                                        <a href="#">@news.CreateBy</a>
                                        <p>  </p>
                                        <img src="@avatar" alt="" width="100px" />
                                        <span>Ngày tham gia Nov 2010</span>
                                        <span>Bài viết 4,046</span>
                                    </li>
                                    <li class="thanhvienviet">
                                    	@Html.Raw(news.ContentVN)
                                    </li>
                                </ul>
                            </div>
     </div>
     <div class="ctbaiviet">
        <div class="ngayvietchude"><p>Trả lời chủ đề</p></div>
        <div class="tlchude">
            <form name="input" action="html_form_action.asp" method="get">
                <textarea name="message" rows="4" id="message" cols="" style=" width:712px; height:60px; background:white; border:1px solid #ddd; float:left;"></textarea>
                <input type="submit" value="Gửi trả lời" style=" float:right; margin-top:10px;" />
            </form>
        </div>
    </div>
</div>
<div class="tinkhac">
    @if (lang)
    {
    <p>Các bài viết khác</p>
    }
    else
    {
        <p>Others</p>
    }
    <ul>
        @foreach (var item in relative)
        {
            DateTime timex = item.CreateDate.HasValue ? item.CreateDate.Value : DateTime.Now;
            <li><a href="/@string.Concat(langText, "articles/detail/", item.TLink)">@item.Title <span>@PNProject.PNLibraries.PNTimeFormat(timex, false, lang)</span></a></li>
        }                           	
                                
    </ul>
</div>
<script type="text/javascript">
    $(document).ready(function () {
        $(".titlesub p").empty();
        $(".titlesub p").append("Bài viết");
    });
</script>